﻿<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY copy "&#169;">
  <!ENTITY nbsp "&#160;">
  <!ENTITY laquo "&#171;">
  <!ENTITY raquo "&#187;">
]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

  <xsl:output encoding="UTF-8"
              method="xml"
              omit-xml-declaration="yes"
              indent="no"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

  <xsl:variable name="Root" select="/page/settings/url" />
  <xsl:variable name="Files" select="/page/settings/files_url" />
  <xsl:variable name="Images" select="/page/settings/images_url" />
  <xsl:variable name="Settings" select="/page/settings" />
  <xsl:variable name="Controller" select="/page/settings/controller" />
  <xsl:variable name="Action" select="/page/settings/action" />
  <xsl:variable name="This" select="/page/settings/this" />
  <xsl:variable name="This_without_lang" select="/page/settings/this_without_lang" />
  <xsl:variable name="Main" select="/page/content/Main" />
  <xsl:variable name="User" select="/page/content/auth-info" />
  <xsl:variable name="Content" select="/page/content" />
  <xsl:variable name="Cats" select="/page/content/Cats" />
  <xsl:variable name="Cat" select="/page/content/@cat" />
  <xsl:variable name="Form" select="/page/content/Main/form" />
  <xsl:variable name="Static" select="/page/content/static" />
  <xsl:variable name="Date" select="/page/content/current-date" />
  <xsl:variable name="Lang" select="/page/settings/lang" />
  <xsl:variable name="Int" select="/page/content/interface" />
  <xsl:variable name="Cart" select="/page/content/cart" />

  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="page">
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <xsl:choose>
          <xsl:when test="$Content/ceo_title = ''">
            <title>
              <xsl:value-of select="$Settings/title"/>
            </title>
          </xsl:when>
          <xsl:otherwise>
            <title>
              <xsl:value-of select="$Content/ceo_title"/>
            </title>
          </xsl:otherwise>
        </xsl:choose>

        <meta name="description" content="{$Content/ceo_desc}"/>
        <meta name="keywords" content="{$Content/ceo_keywords}"/>

        <link href="/css/kadastrova-karta.css" rel="stylesheet" type="text/css" />        

        <script type="text/javascript" src="/js/jq.js">/**/</script>
        <script type="text/javascript" src="/js/system.js">/**/</script>
        <script type="text/javascript" src="/js/map/index.js">/**/</script>

        <script src="http://www.openlayers.org/api/2.12/OpenLayers.js" type="text/javascript"></script>
        <script src="http://maps.google.com/maps/api/js?v=3.2&amp;sensor=false"></script>

        <script type="text/javascript" src="/js/map/config.js">/**/</script>
        <script type="text/javascript" src="/js/region_cities.js">/**/</script>

        

      </head>

      <body onload="init()">
     
          <div class="layout">
            <div class="show-sidebar"></div>
            <div class="sidebar">
              <div class="sidebar-wrap">
                <div class="search-container">
                  <div class="hide">   </div>
                  <div class="search">
                    <p class="title">Кадастровий номер</p>

                    <input type="text" />

                    <p class="example">Наприклад 0525685500:04:001:0004 </p>

                  </div>
                  <div class="full-search">
                    <div class="switcher">
                      <span class="on" rel="1">По кадастровому номеру </span>
                      <span rel="2">По адресу</span>
                    </div>
                    <div class="page form" rel="1">
                      <form class="search-form">
                        <ul>
                          <li>
                            <label>Кадастрові області </label>
                            <select name="id_region" id="id_region">
                              <option> - Всі - </option>
                              <xsl:for-each select="$Main/reion-list/row">
                                <option value="{id}">
                                  <xsl:value-of select="name"/>
                                </option>
                              </xsl:for-each>                              
                            </select>
                          </li>
                          <li>
                            <label>Кадастровий район </label>
                            <select namd="id_district" id="id_district" disabled="true">
                              <option> - Всі - </option>
                            </select>
                          </li>
                          <li>
                            <label>Кадастровый квартал </label>
                            <select  >
                              <option  >1 </option>
                              <option  >2 </option>
                            </select>
                          </li>
                          <li>
                            <label>Земельный участок </label>
                            <select  >
                              <option  >1 </option>
                              <option  >2 </option>
                            </select>
                          </li>
                        </ul>
                      </form>
                    </div>
                    <div class="page form" style="display:none;" rel="2">
                      <form class="search-form">
                        <ul>
                          <li>
                            <label>Адреса</label>
                            <input type="text" />
                          </li>                        
                        </ul>
                      </form>
                    </div>
                  </div>

                  <div class="bottom">
                    <div class="go-search">
                      <input type="submit" value="Шукати"/>
                    </div>

                    <div class="full-search-switcher switcher-open">
                      <span>Расширеный поиск</span>
                    </div>
                  </div>


                </div>
                <div class="results">
                  <p>По вашему запросу найдено 21:</p>
                  <ol>
                    <li>
                      <p class="title">
                        <a href="#">
                          Мещерский филиал ВНИИГ и М
                        </a>
                      </p>
                      <p class="desc"> Рязанская область, Рязань</p>
                    </li>
                    <li>
                      <p class="title">
                        <a href="#">
                          Чаш Копки
                        </a>
                      </p>
                      <p class="desc"> Удмуртская Республика, Селтинский район</p>
                    </li>
                    <li>
                      <p class="title">
                        <a href="#">
                          Мещерский филиал ВНИИГ и М
                        </a>
                      </p>
                      <p class="desc"> Рязанская область, Рязань</p>
                    </li>
                  </ol>
                </div>

              </div>
              <div class="footer">
                © 2012 Все права защищены
              </div>


            </div>
            <div class="header">
              <div class="header-wrap">
                <div class="tools fr">
                  <ul>
                    <li>
                      <a href="#" class="b10"> &nbsp;</a>
                    </li>
                    <li>
                      <a href="#" class="b11">&nbsp;</a>
                    </li>
                  </ul>
                </div>
                <div class="logo">

                  <img src="images/logo.png" width="214" height="48" />
                </div>
                <div class="tools">
                  <ul>
                    <li>
                      <a href="#" class="b1"> &nbsp;</a>
                    </li>
                    <li>
                      <a href="#" class="b2">&nbsp;</a>
                    </li>
                    <li class="separator">&nbsp;</li>
                    <li>
                      <a href="#" class="b3">&nbsp;</a>
                    </li>
                    <li>
                      <a href="#" class="b4">&nbsp;</a>
                    </li>
                    <li class="separator"> &nbsp;</li>
                    <li>
                      <a href="#" class="b5">&nbsp;</a>
                    </li>
                    <li>
                      <a href="#" class="b6">&nbsp;</a>
                    </li>
                    <li class="separator"> &nbsp;</li>

                    <li>
                      <a href="#" class="b7">&nbsp;</a>
                    </li>
                    <li>
                      <a href="#" class="b8">&nbsp;</a>
                    </li>
                    <li>
                      <a href="#" class="b9">&nbsp;</a>
                      <div class="container" style="display:none;">
                        <input type="text" />
                      </div>
                    </li>

                  </ul>
                </div>
              </div>
            </div>
          </div>


          <div class="map map-open">
            <div class="map-wrap" id="map">
              
            </div>
          </div>

          <div id="wrapper">
            <div id="location"></div>
            <div id="scale"></div>
          </div>
       
        </body>
    
    </html>
  </xsl:template>


  <!-- Messages -->
  <xsl:template name="Messages">
    <xsl:if test="Main/form/@sent = 1">
      <div>
        <xsl:if test="Main/form/@error = 1">
          <xsl:attribute name="class">massage_no</xsl:attribute>
        </xsl:if>
        <xsl:if test="Main/form/@error = 0">
          <xsl:attribute name="class">massage_yes</xsl:attribute>
        </xsl:if>
        <xsl:value-of select="Main/form/@message" />
      </div>
    </xsl:if>
  </xsl:template>

  <!-- Path -->
  <xsl:template name="Path">
    <xsl:param name="last"/>

    <div class="path">
      <xsl:for-each select="$Content/Path/row">
        <xsl:if test="position() != last()">
          <a href="{url}">
            <xsl:value-of select="name"/>
          </a>
          <span>›</span>
        </xsl:if>
        <xsl:if test="position() = last() and $last = 1">
          <a href="{url}">
            <xsl:value-of select="name"/>
          </a>
          <span>›</span>
        </xsl:if>
      </xsl:for-each>
    </div>
  </xsl:template>

  <!-- Write.Date -->
  <xsl:template name="Write.Date">
    <xsl:param name="node"></xsl:param>

    <xsl:choose>
      <xsl:when test="$node/@day = $Date/@day and $node/@dmonth = $Date/@dmonth and $node/@year = $Date/@year">
        Сегодня
      </xsl:when>
      <xsl:when test="$node/@day = $Date/@day+1 and $node/@dmonth = $Date/@dmonth and $node/@year = $Date/@year">
        Вчера
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$node/@day"/>
        <xsl:text>.</xsl:text>
        <xsl:value-of select="$node/@dmonth"/>
        <xsl:text>.</xsl:text>
        <xsl:value-of select="$node/@year"/>
      </xsl:otherwise>
    </xsl:choose>

  </xsl:template>

  <!-- Write.Date.Time -->
  <xsl:template name="Write.Date.Time">
    <xsl:param name="node"></xsl:param>
    <xsl:call-template name="Write.Date">
      <xsl:with-param name="node" select="$node"/>
    </xsl:call-template>
    <xsl:text> </xsl:text>
    <xsl:value-of select="$node/@hour"/>
    <xsl:text>:</xsl:text>
    <xsl:value-of select="$node/@minute"/>
  </xsl:template>



</xsl:stylesheet>